#include<stdio.h>
#define n 1000
int tou(int x)
{
  int i=0,j=0,g,h=0;
  char fileName[100];
  char str[n],temp[n];
  printf("输入文件名:");
  gets(fileName);
  FILE *in=fopen(fileName,"r");
  if (in==NULL)
  {
    printf("Error 404: 文件没有找到!");
  }
 else
{
    printf("%07o",0);
        printf("  ");
    while(!feof(in))
     {
      fscanf(in,"%c",&str[i]);
      if (j%16==0&&j!=0)
      {
    printf("\n");
    printf("        ");
        for(g=i-h;g<i;g++)
    {
        printf("%x  ",str[g]);
    }
    printf("\n");
        printf("%07o",j);
    printf("  ");
      }
        printf("%c   ",str[i]);
        i++;
if(str[i+1]=='\n')
{printf("\\n");}
        j++;
        h++;
    if(h==17)
h=1;
    }
printf("  ");
  for(g=i-h;g<i;g++)
    {
        printf("%x  ",str[g]);
    }
  }
  fclose(in);
    printf("\n");
printf("%07o",i);
printf("\n");
 fclose(in);
return 0;
}
